import axios from '@/libs/request/axios'
// 获取一级区域
export const initAppertainRegion = (id, params) => {
    return axios.request({
        url: `/admin/appertainRegion/getByParentId/${id}`,
        params: params,
        method: 'post'
    })
}
// 获取一级区域
export const initAll = (ids,params) => {
    return axios.request({
        url: `/admin/appertainRegion/getAll/${ids}`,
        params: params,
        method: 'post'
    })
}
// 编辑区域
export const editAppertainRegion = (params) => {
    return axios.request({
        url: '/admin/appertainRegion/edit',
        data: params,
        method: 'post'
    })
}
// 添加区域
export const addAppertainRegion = (params) => {
    return axios.request({
        url: '/admin/appertainRegion/add',
        data: params,
        method: 'post'
    })
}
// 删除区域
export const deleteAppertainRegion = (ids, params) => {
    return axios.request({
        url: `/admin/appertainRegion/delByIds/${ids}`,
        params: params,
        method: 'delete'
    })
}
// 搜索区域
export const searchAppertainRegion = (params) => {
    return axios.request({
        url: '/admin/appertainRegion/search',
        params: params,
        method: 'post'
    })
}
// 获取省市区接口
export const getLocation = (params) => {
    return axios.request({
        url: `/admin/common/getAddressList`,
        method: 'POST',
        data: params,
    })
};
